<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title> 3-6 了解成员数量(数组属性length)</title>
    <link rel="stylesheet" type="text/css" href="../../../css/style.css"/>
    <style type="text/css">
    </style>

    <script type="text/javascript">
        var mynum = new Array(65, 90, 88, 98);
        document.write("数组的长度是:" + mynum.length + "<br>");
        document.write("数组的最大下标是：" + (mynum.length - 1) + "<br>");
        document.write(mynum[2] + "<br>"); //显示第3个元素的值88
        mynum.length = 10; //增大数组的长度
        document.write(mynum.length + "<br>"); //数组长度已经变为10
        mynum[15] = 34;  //增加元素，使用索引为15,赋值为34
        alert(mynum.length); //显示数组的长度16
    </script>
</head>

<body>
<div align="center">
    <p><a href="../../index.php#jsjjp" class="fontSize" title="点击进入该目录">目录</a></p>
</div>

<!--<input type="button" onclick="zhencha()" value="点击查询"/>-->

<script type="text/javascript">

</script>

</body>
</html>
